package br.ebula.apl.dao;

import java.sql.CallableStatement;
import java.sql.SQLException;

import br.ebula.apl.bean.Bula;
import br.ebula.apl.dto.DTOAlteraBula;

public class DAOAlteraBula extends DAOGenerico {

	DTOAlteraBula dto;
	
	public void alteraBula(DTOAlteraBula dto) {
		this.dto = dto;
		executaProcedure("altera_bula",5);
	}

	@Override
	void configuraParametros(CallableStatement cstmt) throws SQLException {
		Bula b = dto.getBula();
		cstmt.setInt(1, Integer.parseInt(b.getCodigo()));
		cstmt.setString(2, b.getNome() );
		cstmt.setString(3, b.getPrincipioAtivo() );
		cstmt.setString(4, b.getClasse() );
		cstmt.setString(5, b.getSintomas() );
	}

}
